﻿@model Loja.DataDTO.ProdutoDTO
@using Telerik.Web.Mvc.UI;

<div id="aviso" class="aviso">
    <label>
        *&nbsp;Campo de preenchimento obrigatório.</label></div>
<br />
<div>
    @using (Ajax.BeginForm(ViewData["Action"].ToString(), "Product", new AjaxOptions { HttpMethod = "POST", OnBegin = "Validar", OnSuccess = "onSuccess" }))
    {
        <div>
            <input id="btnSalvar" title="Salvar" type="image" title="Salvar" src="@Url.Content("~/Content/Images/crud/save.png")" />&nbsp;
            <a href="javascript:Cancelar();">
                <img src="@Url.Content("~/Content/Images/crud/undo.png")" title="Cancelar" /></a>
        </div>
    
        <br />
        <div class="grupo">
            @Html.HiddenFor(o => o.Id)
            @{ Html.Telerik().TabStrip()
        .Name("TabStrip")
        .Items(tabstrip =>
        {
            tabstrip.Add()
                .Text("Informações")
                .ImageUrl("~/Content/Common/Icons/Suites/mvc.png")
                .Content(@<text>
                <table width="100%">
                    <tr>
                        <td align="right" style="width: 150px">
                            <label>
                                Categoria:</label>
                        </td>
                        <td>
                            @Html.DropDownList("categorias", (List<SelectListItem>)ViewData["Categoria"], new { @class = "Selector", onChange = "GetSubcategoria(this.value, '0')", style = "width:500px" })
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                Subcategoria:</label>
                        </td>
                        <td>
                            <select id="IdCategoria" name="IdCategoria" onchange="GetCodigo();" style="width: 500px">
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                @Html.LabelFor(p => p.IdFornecedr)</label>
                        </td>
                        <td>
                            @Html.DropDownListFor(p => p.IdFornecedr, (List<SelectListItem>)ViewData["Fornecedor"], new { @class = "Selector", style = "width:500px" })
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                @Html.LabelFor(p => p.IdMarca)</label>
                        </td>
                        <td>
                            @Html.DropDownListFor(p => p.IdMarca, (List<SelectListItem>)ViewData["Marca"], new { @class = "Selector", style = "width:500px" })
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                @Html.LabelFor(p => p.Codigo)</label>
                        </td>
                        <td>
                            @Html.TextBoxFor(p => p.Codigo, new { style = "width:200px" })
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                @Html.LabelFor(p => p.Descricao)</label>
                        </td>
                        <td>
                            @Html.TextAreaFor(p => p.Descricao, new { style = "width:500px" })
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                @Html.LabelFor(p => p.PrecoCusto)</label>
                        </td>
                        <td>
                            @Html.TextBoxFor(p => p.PrecoCusto, new { style = "width:500px" })
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                @Html.LabelFor(p => p.DataCompra)</label>
                        </td>
                        <td>
                           

                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                @Html.LabelFor(p => p.Precentual)</label>
                        </td>
                        <td>
                            @Html.TextBoxFor(p => p.Precentual, new { style = "width:500px" })
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                @Html.LabelFor(p => p.Tags)</label>
                        </td>
                        <td>
                            @Html.TextAreaFor(p => p.Tags, new { style = "width:500px" })
                        </td>
                    </tr>
                </table>
                </text>);

            tabstrip.Add()
                       .Text("Estoque")
                       .ImageUrl("~/Content/Common/Icons/Suites/mvc.png")
                       .Content(@<text>
                @{Html.RenderPartial("_PartialEstoque");}
                </text>);
        })
        .SelectedIndex(0)
        .Render();

            }
        </div>
    }
</div>
